/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ShahanThai
 */
@Entity
@Table(name = "Genres", catalog = "SharingMusic", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Genres.findAll", query = "SELECT g FROM Genres g"),
    @NamedQuery(name = "Genres.findByGenreID", query = "SELECT g FROM Genres g WHERE g.genreID = :genreID"),
    @NamedQuery(name = "Genres.findByGenreName", query = "SELECT g FROM Genres g WHERE g.genreName = :genreName")})
public class Genres implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Basic(optional = false)
    @Column(name = "GenreID", nullable = false)
    private int genreID;
    @Basic(optional = false)
    @Column(name = "GenreName", nullable = false, length = 50)
    private String genreName;
    @OneToMany(mappedBy = "genres")
    private List<Songs> songsList;

    public Genres() {
    }

    public Genres(int genreID) {
        this.genreID = genreID;
    }

    public Genres(int genreID, String genreName) {
        this.genreID = genreID;
        this.genreName = genreName;
    }

    public Genres(String genreName) {
        this.genreName = genreName;
    }

    public int getGenreID() {
        return genreID;
    }

    public void setGenreID(int genreID) {
        this.genreID = genreID;
    }

    public String getGenreName() {
        return genreName;
    }

    public void setGenreName(String genreName) {
        this.genreName = genreName;
    }

    public List<Songs> getSongsList() {
        return songsList;
    }

    public void setSongsList(List<Songs> songsList) {
        this.songsList = songsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash = this.genreID;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Genres)) {
            return false;
        }
        Genres other = (Genres) object;
        if (this.genreID != other.genreID) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.Genres[genreID=" + genreID + "]";
    }

}
